var e = getApp();
Page({
  data: {
    videoad: "",
    isLogin: 1,
    userInfo: {},
    kefuwx: "ixiaoxingyun520",
    kefutxt: "添加客服微信",
    orderCount: {}
  },
  onLoad: function (e) {
    tt.getStorageSync("wxapp") && this.setData({
      videoad: tt.getStorageSync("wxapp").videoad,
      kefuwx: tt.getStorageSync("wxapp").kefuwx,
      kefutxt: tt.getStorageSync("wxapp").kefutxt
    });
  },
  onShow: function () {},
  copaywx: function () {
    var e = this,
        t = e.data.kefuwx;
    console.log("kefuwx" + t), t || (t = e.data.kefuwx), tt.setClipboardData({
      data: t,
      success: function (e) {
        tt.showModal({
          title: "提示",
          content: "客服微信号已经复制成功，打开微信添加好友吧",
          showCancel: !1,
          confirmText: "好的",
          success: function (e) {}
        });
      }
    });
  },
  getUserDetail: function () {
    var t = this;

    e._get("user.index/detail", {}, function (e) {
      t.setData(e.data);
    });
  },
  onTargetOrder: function (e) {
    if (!this.onCheckLogin()) return !1;
    var t = {
      all: "/pages/order/index?type=all",
      payment: "/pages/order/index?type=payment",
      delivery: "/pages/order/index?type=delivery",
      received: "/pages/order/index?type=received"
    };
    tt.navigateTo({
      url: t[e.currentTarget.dataset.type]
    });
  },
  onTargetMenus: function (e) {
    if (!this.onCheckLogin()) return !1;
    tt.navigateTo({
      url: "/" + e.currentTarget.dataset.url
    });
  },
  onLogin: function () {
    tt.navigateTo({
      url: "../login/login"
    });
  },
  onCheckLogin: function () {
    return !!this.data.isLogin || (e.showError("很抱歉，您还没有登录"), !1);
  }
});